// Simple ajax post function.

function ajax_json_post(url, datastring) {
	$.ajax({
		type : "POST",
		url : url,
		data : datastring,
		dataType : 'json',
		success : function(data) {
			return data;
		}
	});
}

function notify(data) {
	$.jGrowl(data);
}

function resetForm(formId) {
	$('#' + formId).find(':input').val('');
}

// Global functions.
function load_admin_tabs(data, target) {
	$('#' + target).load(data);
}

// 



function drawTable(divelem) {
	var data = new google.visualization.DataTable();
	data.addColumn('string', 'Name');
	data.addColumn('number', 'Salary');
	data.addColumn('boolean', 'Full Time Employee');
	data.addRows(4);
	data.setCell(0, 0, 'Mike');
	data.setCell(0, 1, 10000, '$10,000');
	data.setCell(1, 0, 'Jim');
	data.setCell(1, 1, 8000, '$8,000');
	data.setCell(2, 0, 'Alice');
	data.setCell(2, 1, 12500, '$12,500');
	data.setCell(3, 0, 'Bob');
	data.setCell(3, 1, 7000, '$7,000');

	var table = new google.visualization.Table(document.getElementById(divelem));
	table.draw(data, {
		showRowNumber : true
	});

	google.visualization.events.addListener(table, 'select', function() {
		var row = table.getSelection()[0].row;
		alert('You selected ' + data.getValue(row, 0));
	});

}



// Add Custom WebService
function add_custom_web_service(data, formId) {

}